package com.linh.rmi.common;

import java.io.Serializable;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class ServerInvocationHandler implements Serializable, InvocationHandler {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private InvocationDelegate delegate;

	public ServerInvocationHandler(InvocationDelegate delegate) {
		super();
		this.delegate = delegate;
	}

	@Override
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		return delegate.invoke(proxy, method.getName(),
				method.getParameterTypes(), args);
	}

}
